package com.foreknow.demo5Exercise1;

/**
 * 5.2定义一个Constructor类：
 * 5.2.1创建两个对象，分别是zhangsan，33岁，1.73；lishi，44，1.74
 * 5.2.2分别调用对象的sayHello()方法。???
 */
public class Constructor {

    private String name;
    private int age;
    private double height;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public static void main(String[] args) {
        Constructor person1 = new Constructor();
        person1.setName("zhangsan");
        person1.setAge(33);
        person1.setHeight(1.73);
        System.out.println("名字："+person1.getName()+"年龄："+person1.getAge()+"身高："+person1.getHeight());
        Constructor person2 = new Constructor();
        person2.setName("lishi");
        person2.setAge(44);
        person2.setHeight(1.74);
        System.out.println("名字："+person2.getName()+"年龄："+person2.getAge()+"身高："+person2.getHeight());
        Person.sayHello();

    }

}
